/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package foxmob.mooc;
import foxmob.mooc.blog.BlogAction;
import foxmob.mooc.course.CourseBook;
import foxmob.mooc.file.FileHandler;
import foxmob.mooc.library.LibraryAction;
import foxmob.mooc.user.TrainingReg;
import foxmob.mooc.user.UserAction;
import foxmob.mooc.wx.Handler;

import static spark.Spark.port;

/**
 *
 * @author liyusen
 */
public class Main {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int nPort = 8020;
        if(args.length>0){
            int aport = Integer.parseInt(args[0]);
            if(aport>8020) nPort = aport;
        }

        port(nPort);
        System.out.println("port:"+nPort);

        AppCfg.init();
        DbAccess.init();
//        Course.init();
        CourseBook.init();
        UserAction.init();
        LibraryAction.init();
        BlogAction.init();
        Handler.init();
        TrainingReg.init();
        FileHandler.init();
    }

}

